<template>
	<view class="log">
		<view v-for="(item,index) in list" :key="index" class="content-list u-flex-row u-flex-between u-flex-y-center">
			<view>
				<view class="ice-mb-10 font-28" style="color: #FFF;">{{item.memo}}</view>
				<view class="opc5">{{item.create_time_text}}</view>
			</view>
			<view v-if="item.money>=0" class="green font-32" style="font-weight: bold;">+{{item.money}}</view>
			<view v-else class="red font-32" style="font-weight: bold;">{{item.money}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				param: {
					page: 1,
					type: '',
				},
				over: false,
				list: [],
			}
		},
		onLoad(e) {
			this.param.type = e.type;
			if (e.type == 'money') {
				uni.setNavigationBarTitle({
					title: "USDT"
				})
			} else if (e.type == 'matic') {
				uni.setNavigationBarTitle({
					title: "MATIC"
				})
			} else if (e.type == 'mtcc') {
				uni.setNavigationBarTitle({
					title: "MTCC"
				})
			}
			this.getList()
		},
		onReachBottom() {
			this.getList()
		},
		onPullDownRefresh() {
			this.list = [];
			this.over = false;
			this.param.page = 1;
			this.getList()
		},
		methods: {
			getList() {
				if (this.over) {
					return;
				}
				uni.$ice.post('wallet/log', this.param, false).then(res => {
					if (this.param.page == 1) {
						this.list = res.data
					} else {
						this.list = this.list.concat(res.data);
					}
					if (res.data.length < 20) {
						this.over = true;
					} else {
						this.param.page++;
					}
					uni.stopPullDownRefresh()

				}).catch(err => {

				})
			}
		}
	}
</script>

<style scoped>
	.log{
		padding: 30rpx;
	}
	.green{
		color: #00b500!important;
	}
	.red {
	    color: #ff4b76 !important;
	}
	.opc5{
		opacity: .5;
		font-size: 24rpx;
	}
	 .content-list {
		background-color: #1f1c68;
		border: 1px solid none;
		box-shadow: -1px 0 3px #6c4eed, 0 -1px 2px #69bbf5, 1px 0 3px #f56971;
		padding:30rpx;
		margin-bottom: 30rpx;
	}
</style>